package test.enba.mq.consumer.rocketmq;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Service;

@Service
@RocketMQMessageListener(topic = "pubsub-topic", consumerGroup = "pubsub-consumer-group-2")
public class PubSubConsumer2 implements RocketMQListener<String> {

  @Override
  public void onMessage(String message) {
    System.out.println("Consumer2 received message: " + message);
    // 处理消息逻辑
  }
}
